<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			// var re=/hi/;
			// var str="adsadahidasdahi";
			// var re=/\bhi\b/;
			// var str="hi";
			// var re=/\bh.*i\b/;
			// var str="hladosanicbai";
			// var re=/\b\d\d\d-\d\d\d\d\d\d\d\d\b/;
			// var re=/\b\d{3}-\d{8}/;
			// var str="233-56789323";
			// var re=/^\w{3}\d{5}$/;
			// var str="asd12345";
			// var re=/^\d{5,12}/;
			// var str="12345aaa";
			var re=/^\(?0\d{2}[\ -]?\d{8}$/;
			var str="027-67891234";
			var re=/^\(0\d{2}\)[ -]?\d{8}|^0\d{2}[ -]?\d{8}$/;
			var re=/^((2[0-4]\d|25[0-5]|[01]?\d\d?).){3}(2[0-4]\d|25[0-5]|[01]?\d?\d)$/;//点是占位的作用，此占位填不填均可
		    var str="192168100123";
			// [01]?\d\d?和[01]?\d?d为什么没有？答:在前和在后,会互补
			console.log(re.test(str));
			var str="ashedfghery";
			var re=/he/;
			console.log(str.search(re));
			var str="asgoodwerdase";
			var re=/g.*?d/;//贪婪与懒惰
			console.log(str.replace(re,"kang"));
		</script>
	</body>
</html>
